﻿using UnityEngine;
using static EntityManager;
using static UnityEngine.InputSystem.InputAction;

public class InputHandle : MonoBehaviour
{
    public void OnMove(CallbackContext callback)
    {
        var input = callback.ReadValue<Vector2>();
        if (input == Vector2.zero)
            return;

        RefAction<MoveComponent> refAction = (ref MoveComponent move) => {
            move.moveDirection.x = input.x * 90;
            move.moveDirection.y = input.y * 90;
        };
        UpdateComponent(ref refAction);
    }
}
